// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

using System;
using System.Threading;
using System.Threading.Tasks;

#nullable restore
namespace Elastic.Clients.Elasticsearch.SearchableSnapshots
{
	public class SearchableSnapshotsNamespace : NamespacedClientProxy
	{
		internal SearchableSnapshotsNamespace(ElasticsearchClient client) : base(client)
		{
		}

		public SearchableSnapshotsMountResponse Mount(SearchableSnapshotsMountRequest request)
		{
			request.BeforeRequest();
			return DoRequest<SearchableSnapshotsMountRequest, SearchableSnapshotsMountResponse>(request);
		}

		public Task<SearchableSnapshotsMountResponse> MountAsync(SearchableSnapshotsMountRequest request, CancellationToken cancellationToken = default)
		{
			request.BeforeRequest();
			return DoRequestAsync<SearchableSnapshotsMountRequest, SearchableSnapshotsMountResponse>(request, cancellationToken);
		}

		public SearchableSnapshotsMountResponse Mount(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot)
		{
			var descriptor = new SearchableSnapshotsMountRequestDescriptor(repository, snapshot);
			descriptor.BeforeRequest();
			return DoRequest<SearchableSnapshotsMountRequestDescriptor, SearchableSnapshotsMountResponse>(descriptor);
		}

		public SearchableSnapshotsMountResponse Mount(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Action<SearchableSnapshotsMountRequestDescriptor> configureRequest)
		{
			var descriptor = new SearchableSnapshotsMountRequestDescriptor(repository, snapshot);
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequest<SearchableSnapshotsMountRequestDescriptor, SearchableSnapshotsMountResponse>(descriptor);
		}

		public Task<SearchableSnapshotsMountResponse> MountAsync(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, CancellationToken cancellationToken = default)
		{
			var descriptor = new SearchableSnapshotsMountRequestDescriptor(repository, snapshot);
			descriptor.BeforeRequest();
			return DoRequestAsync<SearchableSnapshotsMountRequestDescriptor, SearchableSnapshotsMountResponse>(descriptor);
		}

		public Task<SearchableSnapshotsMountResponse> MountAsync(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Action<SearchableSnapshotsMountRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
		{
			var descriptor = new SearchableSnapshotsMountRequestDescriptor(repository, snapshot);
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequestAsync<SearchableSnapshotsMountRequestDescriptor, SearchableSnapshotsMountResponse>(descriptor);
		}

		public SearchableSnapshotsStatsResponse Stats(SearchableSnapshotsStatsRequest request)
		{
			request.BeforeRequest();
			return DoRequest<SearchableSnapshotsStatsRequest, SearchableSnapshotsStatsResponse>(request);
		}

		public Task<SearchableSnapshotsStatsResponse> StatsAsync(SearchableSnapshotsStatsRequest request, CancellationToken cancellationToken = default)
		{
			request.BeforeRequest();
			return DoRequestAsync<SearchableSnapshotsStatsRequest, SearchableSnapshotsStatsResponse>(request, cancellationToken);
		}

		public SearchableSnapshotsStatsResponse Stats()
		{
			var descriptor = new SearchableSnapshotsStatsRequestDescriptor();
			descriptor.BeforeRequest();
			return DoRequest<SearchableSnapshotsStatsRequestDescriptor, SearchableSnapshotsStatsResponse>(descriptor);
		}

		public SearchableSnapshotsStatsResponse Stats(Action<SearchableSnapshotsStatsRequestDescriptor> configureRequest)
		{
			var descriptor = new SearchableSnapshotsStatsRequestDescriptor();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequest<SearchableSnapshotsStatsRequestDescriptor, SearchableSnapshotsStatsResponse>(descriptor);
		}

		public SearchableSnapshotsStatsResponse Stats<TDocument>(Action<SearchableSnapshotsStatsRequestDescriptor<TDocument>> configureRequest)
		{
			var descriptor = new SearchableSnapshotsStatsRequestDescriptor<TDocument>();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequest<SearchableSnapshotsStatsRequestDescriptor<TDocument>, SearchableSnapshotsStatsResponse>(descriptor);
		}

		public Task<SearchableSnapshotsStatsResponse> StatsAsync(CancellationToken cancellationToken = default)
		{
			var descriptor = new SearchableSnapshotsStatsRequestDescriptor();
			descriptor.BeforeRequest();
			return DoRequestAsync<SearchableSnapshotsStatsRequestDescriptor, SearchableSnapshotsStatsResponse>(descriptor);
		}

		public Task<SearchableSnapshotsStatsResponse> StatsAsync(Action<SearchableSnapshotsStatsRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
		{
			var descriptor = new SearchableSnapshotsStatsRequestDescriptor();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequestAsync<SearchableSnapshotsStatsRequestDescriptor, SearchableSnapshotsStatsResponse>(descriptor);
		}

		public Task<SearchableSnapshotsStatsResponse> StatsAsync<TDocument>(Action<SearchableSnapshotsStatsRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
		{
			var descriptor = new SearchableSnapshotsStatsRequestDescriptor<TDocument>();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequestAsync<SearchableSnapshotsStatsRequestDescriptor<TDocument>, SearchableSnapshotsStatsResponse>(descriptor);
		}
	}
}